package com.hamizhong.iflowers.web.action;

import net.sf.json.JSONObject;

import com.hamizhong.iflowers.utils.MyConstants;
import com.hamizhong.iflowers.web.base.MyBaseAjaxAction;
import com.hamizhong.iflowers.web.vo.UserVO;

public class AjaxCheckUserLoginAction extends MyBaseAjaxAction {

	@Override
	protected JSONObject doRequest() {
		logger.info("...invoke...AjaxCheckUserLoginAction...");
		JSONObject jo = new JSONObject();
		try {
			UserVO loginUserVO = (UserVO) getSSN().getAttribute(MyConstants.IFLOWERS_LOGIN_USER_VO);
			if(loginUserVO != null && !loginUserVO.equals("null")) {
				jo.put("result", MyConstants.AJAX_SUCCESS);
			}else {
				jo.put("result", MyConstants.AJAX_FAILED_LOGIN);
			}
			return jo;
		} catch (Exception e) {
			jo.put("result", MyConstants.AJAX_FAILED_ALERT);
			return jo;
		}
	}

}
